2026-09-27 · class-notes, tryhackme, load-balancer, cdn, waf, web-servers, virtual-hosts, backend
Full class notes for TryHackMe module 9: load balancers, CDNs, databases, WAFs, web server software, virtual hosts, and static vs dynamic content.
Class notes · TryHackMe Pre Security · Module 9
Quick reference: the short version of this lesson lives in the TryHackMe resource sheets. This ties together Modules 6–8 (DNS, HTTP, how websites are built) into the fuller picture of what actually sits behind a busy website — and introduces the web server software itself.
Numbering note: the update block again labelled this "SECTION/UNIT: 6". This transcript explicitly opens by referring back to "the previous modules" (DNS, HTTP, and website structure), which confirms it belongs after those three — filed here as Module 9, continuing the established sequence.
By the end of these notes you should be able to:
Pulling the earlier modules together: requesting a website means your computer first needs the server's IP address, found via DNS. Your computer then talks to that server using HTTP, a defined set of commands. The web server responds with HTML, JavaScript, CSS, images, and so on, which your browser assembles and displays as the page you see.
That covers the core request/response cycle. A busy, real-world website usually has several more components working alongside it.
A single web server eventually runs out of capacity — either the traffic gets too large, or the application needs high availability that one server cannot guarantee alone. A load balancer solves both problems at once:
When a load balancer is in front of a site, it receives the request first, then forwards it to one of the servers behind it, using an algorithm to decide which:
Load balancers also run periodic health checks against each server behind them. If a server fails to respond, or responds incorrectly, the load balancer stops routing traffic to it until it starts responding properly again.
Load balancer in front of a web tier:
+----------------+
client ----> | Load balancer |
| (algorithm + |
| health check) |
+--------+-------+
|
+-----------------+-----------------+
v v v
[ Server 1 ] [ Server 2 ] [ Server 3 ]
(healthy) (healthy) (unresponsive,
removed from
rotation)
A CDN cuts down traffic hitting a busy website by hosting its static files — JavaScript, CSS, images, video — across thousands of servers worldwide, rather than serving everything from one location.
When a user requests one of those hosted files, the CDN works out the physically nearest server to that user and serves the file from there, instead of potentially routing the request across the world to the original server.
Websites commonly need to store information — user accounts, content, settings — and web servers communicate with databases to store and retrieve that data. Databases range enormously in scale, from a simple plain text file up to complex clusters of multiple servers built for speed and resilience.
Common databases you will encounter include MySQL, MSSQL, MongoDB, Postgres, and others — each with its own particular strengths.
A WAF (Web Application Firewall) sits between an incoming web request and the actual web server. Its job is to protect the server from hacking attempts and denial-of-service attacks by inspecting requests for:
If a request is judged a likely attack, the WAF drops it — it is never forwarded to the web server at all.
A web server is the software that listens for incoming connections and uses HTTP to deliver content to clients. Common examples: Apache, Nginx, IIS, and NodeJS.
Files are delivered from the server's configured root directory. Defaults differ by platform:
| Software | Platform | Default root directory |
|---|---|---|
| Apache, Nginx | Linux | /var/www/html |
| IIS | Windows | C:\inetpub\wwwroot |
For example, a request for http://www.example.com/picture.jpg would cause
the server to send the file at /var/www/html/picture.jpg from its own local
disk (on a Linux server using that default).
A single web server can host multiple websites, each with a different domain name, using virtual hosts. The server software checks the hostname being requested — read from the request's HTTP headers — and matches it against its configured virtual hosts, which are simply text-based configuration files. If a match is found, that site is served; if not, the server falls back to its default website.
Each virtual host can point its root directory at a different location on
disk — for example, one.com mapped to /var/www/website_one, and two.com
mapped to /var/www/website_two. There is no limit to how many separate
websites one server can host this way.
One server, multiple virtual hosts:
Host: one.com --> matches virtual host "one.com"
--> serves /var/www/website_one
Host: two.com --> matches virtual host "two.com"
--> serves /var/www/website_two
Host: (unknown) --> no match --> serves the default website
Static content never changes — common examples are images, JavaScript and CSS, but also includes HTML that stays the same. Static files are served directly from the web server's disk, unmodified.
Dynamic content can change depending on the specific request. A blog's homepage showing its latest posts is dynamic — publish a new post, and the homepage updates. A search page is another example: different search terms produce different results.
The work that produces dynamic output happens on the backend — so called because it happens behind the scenes. You cannot see backend processing by viewing a page's HTML source; the HTML you do see is the result of that backend processing. Everything visible in the browser is the frontend.
Backend languages are what give a website real interactivity, and there is very little limit to what they can do — interacting with databases, calling external services, processing user input, and much more. Common examples: PHP, Python, Ruby, NodeJS, Perl, among many others.
Requesting http://example.com/index.php?name=adam, where index.php
contains:
<html><body>Hello <?php echo $_GET["name"]; ?></body></html>
produces this output sent to the client:
<html><body>Hello adam</body></html>
The query string value (name=adam) is read by the PHP code on the
server via $_GET["name"], and the server substitutes that value into
the page before sending it. Crucially, the client never sees the PHP code
itself — only the final HTML result — because the PHP runs entirely on the
backend.
Exam tip: the transcript flags this directly — this kind of interactivity is exactly what opens up security issues in web applications that are not built securely, a thread the course picks up in later modules.
This lesson's own text already gestures toward security, so the additions here connect its components more explicitly to attack and defence:
$_GET["name"] value in the PHP snippet above is exactly the kind of
unsanitised input that, handled carelessly, leads to HTML injection, SQL
injection against a database, or worse./var/www/html on Linux, C:\inetpub\wwwroot on
Windows); virtual hosts let one server host many domains, matched by
the request's Host header.| Term | Meaning |
|---|---|
| Load balancer | Distributes requests across multiple servers. |
| Round-robin | A load-balancing algorithm cycling through servers in turn. |
| Weighted (load balancing) | Routes to the currently least-busy server. |
| Health check | A load balancer's periodic check that a server is responding. |
| CDN | Content Delivery Network; serves static files from nearby servers. |
| Database | Software storing and retrieving structured data. |
| WAF | Web Application Firewall; filters requests before the web server. |
| Rate limiting | Capping requests per IP per second. |
| Web server (software) | Software listening for connections and serving content via HTTP. |
| Root directory | The base folder a web server serves files from. |
| Virtual host | A configuration letting one server host multiple domains. |
| Host header | The HTTP header identifying which site is being requested. |
| Static content | Content served unchanged, as-is. |
| Dynamic content | Content generated per-request by backend processing. |
| Backend | Server-side processing invisible in the page's HTML source. |
| Frontend | Everything visible/rendered in the browser. |
Host: two.com at a server configured
with virtual hosts for one.com and two.com. Which site is served?/var/www/html on Linux
(Apache/Nginx), C:\inetpub\wwwroot on Windows (IIS). Platform defaults.two.com, served from its mapped root
directory. Header-matched virtual host.